#!/usr/bin/python2.6

import posixpath

curr_path = posixpath.os.path.abspath('.')

for name in posixpath.os.listdir(curr_path):
    try:
        path = posixpath.join(curr_path, name)
        f = open(path)
        s = f.read()
        f.close()
        s = s.decode('GB2312').encode('utf-8')
        f = open(path, 'w')
        f.write(s)
        f.close()
    except:
        pass

print 'Encode over.'
